package com.xyzq.dao.ya.hibernate;

import java.util.Date;
import java.util.List;

import org.appfuse.dao.hibernate.GenericDaoHibernate;
import org.springframework.stereotype.Repository;

import com.xyzq.dao.ya.AccountDayFundDAO;
import com.xyzq.model.ya.data.Account;
import com.xyzq.model.ya.data.AccountDayFund;

@Repository("accountDayFundDao")
public class AccountDayFundDaoHibernate extends
		GenericDaoHibernate<AccountDayFund, Long> implements AccountDayFundDAO {

	public AccountDayFundDaoHibernate() {
		super(AccountDayFund.class);
		// TODO Auto-generated constructor stub
	}

	public List<AccountDayFund> findWithValueDate(Date valueDay) {
		// TODO Auto-generated method stub
		return this.getHibernateTemplate().find(
				"from AccountDayFund where day=?", valueDay);
	}

	public List<AccountDayFund> findWithValueDate(Date valueDay, Account account) {
		// TODO Auto-generated method stub
		return this.getHibernateTemplate().find(
				"from AccountDayFund where day=? and FK_ACCOUNT_ACCOUNT=?",
				valueDay, account.getId());
	}

}
